-- GENERATED SPELL FOR [Deadwood Shaman] --


function spell0_7158(pUnit, Event) --@Chain Lightning,n/a--
pUnit:FullCastSpellOnTarget(12058,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_7158', 3000, 1)
end

function spell1_7158(pUnit, Event) --@Curse of the Deadwood,Heal--
pUnit:FullCastSpellOnTarget(13583,pUnit)
pUnit:RegisterEvent('Sorts_7158', 2000, 1)
end

function spell2_7158(pUnit, Event) --@Lightning Bolt,n/a--
pUnit:FullCastSpellOnTarget(9532,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_7158', 3000, 1)
end

function spell3_7158(pUnit, Event) --@Lightning Shield,n/a--
pUnit:FullCastSpellOnTarget(13585,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_7158', 0, 1)
end

function Sorts_7158(pUnit, Event)
local choix_sorts_7158 = math.random(0, 3)
if choix_sorts_7158 == 0 then
pUnit:RegisterEvent('spell0_7158', 1, 1)
end
if choix_sorts_7158 == 1 then
pUnit:RegisterEvent('spell1_7158', 1, 1)
end
if choix_sorts_7158 == 2 then
pUnit:RegisterEvent('spell2_7158', 1, 1)
end
if choix_sorts_7158 == 3 then
pUnit:RegisterEvent('spell3_7158', 1, 1)
end
end

function mob7158_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_7158', math.random(1500, 3000), 1)
end

function mob7158_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob7158_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob7158_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(7158, 1, 'mob7158_Action')
RegisterUnitEvent(7158, 2, 'mob7158_Leave')
RegisterUnitEvent(7158, 3, 'mob7158_Kill')
RegisterUnitEvent(7158, 4, 'mob7158_Die')
